import hashlib

class UUMD5Util:
    @staticmethod
    def bytes_to_hex(bytes_data: bytes, upper_case: bool = True) -> str:
        """Convert bytes to hexadecimal string.
        
        Args:
            bytes_data: Bytes to convert
            upper_case: Whether to return uppercase hex string
            
        Returns:
            Hexadecimal string representation of the bytes
        """
        hex_str = ''.join([f'{b:02x}' for b in bytes_data])
        return hex_str.upper() if upper_case else hex_str

    @staticmethod
    def get_md5(message: str, upper_case: bool = True) -> str:
        """Get MD5 hash of a string message.
        
        Args:
            message: String message to hash
            upper_case: Whether to return uppercase hex string
            
        Returns:
            MD5 hash of the message
        """
        md5_hash = hashlib.md5(message.encode('utf-8')).digest()
        return UUMD5Util.bytes_to_hex(md5_hash, upper_case)
        
    @staticmethod
    def generate_md5(message: str) -> str:
        """Generate MD5 hash of a string message (alias for get_md5).
        
        Args:
            message: String message to hash
            
        Returns:
            MD5 hash of the message in uppercase
        """
        return UUMD5Util.get_md5(message, upper_case=True)
